<template>
    <div class='accountsetting-container'>
        <navcon></navcon>
        <navsearch></navsearch>

        <div class="ac-container">
            <div class="left-container">
                <div class="my-deal">
                    <span>全部功能</span>
                </div>
                <div class="l-c-allTip">
                    <ul>
                        <li><span @click="goCart()">我的购物车</span></li>
                        <li><span @click="goBuys()">已买到的物品</span></li>
                        <li><span @click="goCollect()">我的收藏</span></li>
                        <li><span @click="goInterest()">我的关注</span></li>
                        <li><span @click="goComment()">评论管理</span></li>
                    </ul>
                </div>
            </div>
            <div class="right-container">
                <div class="rc-controller">
                    <router-view></router-view>
                </div>
            </div>
        </div>
        <bottom></bottom>
    </div>
</template>
<script>
// 导入组件
import navcon from "../../components/navcon.vue"
import navsearch from "../../components/navsearch.vue"
import bottom from "../../components/navbottom.vue"
import getUUID from "../../utils/uuid"

// 导出模块
export default {
    // 模块名字
    name: 'accountsetting',
    // 模块数据
    data() {
        //数据
        return {
            memberVo: []
        };
    },
    // 注册组件
    components: {
        navcon,
        navsearch,
        bottom,
    },
    methods: {

        test() {
            this.$router
        },

        goCart() {
            if (window.location.href.includes('/member/accountsetting/cart')) {
                this.$router.go(0);
            }
            this.$router.push({ path: '/member/accountsetting/cart',query:{params: getUUID()} })
        },
        goBuys() {
            if (window.location.href.includes('/member/accountsetting/orderlist')) {
                this.$router.go(0);
            }
            this.$router.push({ path: '/member/accountsetting/orderlist' ,query:{params: getUUID()}})
        },
        goCollect() {
            if (window.location.href.includes('/member/accountsetting/collect')) {
                this.$router.go(0);
            }
            this.$router.push({ path: '/member/accountsetting/collect',query:{params: getUUID()} })
        },
        goComment(){
            if ( window.location.href.includes('/member/accountsetting/comment')){
                this.$router.go(0);
            }
            this.$router.push({path: '/member/accountsetting/comment' ,query:{params: getUUID()}})
        },
        goInterest(){
            if ( window.location.href.includes('/member/accountsetting/interest')){
               this.$router.go(0);
            }
            this.$router.push({path: '/member/accountsetting/interest' ,query:{params: getUUID()}})
        },


    },
    async created() {
        let member = await this.$memberInfo()
        if (member !== null) {
            this.memberVo = member;
        }
    }
}
</script>
<style scoped>
@import url("../../utils/css/accountsetting.css");
</style>
